<?php
include 'cabecalhoAdm.php';
$metodo = "buscaProdutos";

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $metodo = "cadastro";  
    //print $metodo;
}
require_once '../../Controller/Controller.Promocao.php';

?>
<div class="containers">
    <h1>Adicionar Promoção</h1>
    <form action="" method="GET" id="formB">
        <label>Tipo de seleção: </label>
        <select name="tipoSelecao">
            <option value="pro" <?php if(isset($_GET['tipoSelecao']) && $_GET['tipoSelecao'] == 'pro') echo 'selected="selected"'; ?>>Produto</option>
            <option value="aut" <?php if(isset($_GET['tipoSelecao']) && $_GET['tipoSelecao'] == 'aut') echo 'selected="selected"'; ?>>Autor</option>
            <option value="cat" <?php if(isset($_GET['tipoSelecao']) && $_GET['tipoSelecao'] == 'cat') echo 'selected="selected"'; ?>>Categoria</option>
            <option value="edi" <?php if(isset($_GET['tipoSelecao']) && $_GET['tipoSelecao'] == 'edi') echo 'selected="selected"'; ?>>Editora</option>
        </select>
       <input type="SUBMIT" value="buscar" class="bt_buscar"/>
    </form>
    <form class="form-admin" action="<?php $_SERVER['PHP_SELF']; ?>" method="POST" enctype="multipart/form-data">
        <label>Nome:</label><input type="text" name="nome"/><br>
        <label>Data inicio:</label><input type="text" name="dataInicio"/><br>
        <label>Data Final:</label><input type="text" name="dataFinal"/><br>
        <label>Tipo desconto:</label>
        <select name="tipoDesconto">
            <option value="$">Valor</option>
            <option value="%">Porcentagem</option>
        </select>
        <label>Desconto:</label><input type="text" name="desconto"/><br>

        <table>            
            <?php
            foreach ($lista as $value) {
                echo "<tr><td>" . $value->getNome() . "</td>";   
                echo '<td><input type="checkbox" name="valor[]" value="' . $value->getId() . '" /><td></tr>';
            }
            ?>
        </table>
</div>
<input type="SUBMIT" value="Salvar" class="bt_buscar"/>
</form>
</div>
<div id="rodape">		
</div>
</div>
</body>
</html>